var o = require("./UISoundManager.js"), i = require("./UIPopupBase.js");
cc.Class({
    extends: i,
    properties: {
        winFont: {
            default: null,
            type: cc.Font
        },
        loseFont: {
            default: null,
            type: cc.Font
        }
    },
    init: function () {
    },
    onLoad: function () {
        this._billList = Global.utils.searchNode(this.node, "billList"), this.showItem();
    },
    showItem: function () {
        var e = Global.tableModel.getPlayerModel(Global.config.SEAT_DOWN);
        if (e) {
            var t = e.getDetailInfo() || [];
            if (t.length > 0) {
                for (var n = 0, o = 0; o < t.length; o++) {
                    var i = this.getItem(o);
                    i.active = !0;
                    var a = new cc.Color();
                    Global.utils.searchNode(i, "pay_num").color = a.fromHEX("#d81515");
                    var r = "+" + Global.utils.exchangeToWan(t[o][2]);
                    t[o][2] < 0 && (r = Global.utils.exchangeToWan(t[o][2]), Global.utils.searchNode(i, "pay_num").color = a.fromHEX("#1981ca")),
                        Global.utils.searchComp(i, "msg", cc.Label).string = Global.utils.getFixString(t[o][0], 7),
                        Global.utils.searchComp(i, "multiple", cc.Label).string = t[o][1], Global.utils.searchComp(i, "pay_num", cc.Label).string = r,
                        Global.utils.searchComp(i, "position", cc.Label).string = t[o][3], n += parseInt(t[o][2]);
                }
                var s = Global.utils.searchComp(this.node, "total", cc.Label);
                s.font = this.winFont, s.string = n, n < 0 && (s.font = this.loseFont);
            } else this._billList.removeAllChildren(), Global.utils.searchComp(this.node, "total", cc.Label).string = 0;
        }
    },
    getItem: function (e) {
        if (this._billList) {
            if (e < this._billList.children.length) return this._billList.children[e];
            var t = cc.instantiate(this._billList.children[0]);
            return this._billList.addChild(t), t;
        }
    },
    OnPanelClose: function () {
        o.playEffect("select"), this.closePanel();
    }
})
